package io.gitee.chearnee.fw.openapi.constant.enums;

import lombok.AllArgsConstructor;
import lombok.Getter;

import java.util.Arrays;
import java.util.List;
import java.util.stream.Collectors;

/**
 * @author cn
 * @version 1.0
 * @description
 * @date 2021/9/24 14:40
 */
@Getter
@AllArgsConstructor
public enum HeadersEnum {

  /**
   * appId
   */
  APPID("appid", true),
  TIMESTAMP("timestamp", true),
  NONCE_STRING("noncestr", true),
  SIGNATURE("signature", true),
  APP_KEY("appkey", false),
  AUTHORIZATION("authorization", false);
  public static final List<String> REQUIRED_HEADERS_VALUES = Arrays.stream(values())
      .filter(HeadersEnum::getRequired).map(HeadersEnum::getValue)
      .collect(
          Collectors.toList());
  private final String value;
  private final Boolean required;
}
